<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>axios手写</title>
</head>
<body>
	<button>params</button>
</body>
<script src="./node_modules/axios/dist/axios.js"></script>
<script type="module">
	import axios from "./index.js";
	const btn = document.querySelector("button");
	// 1 get传递参数是通过查询字符串-- http://zhangpeiyue.com/info?a=1&b=2
	// 2 get传递参数可以作为地址的一部分-- http://zhangpeiyue.com/info/1/2
	// 3 post传递参数是放置在请求体当中。
	btn.onclick = async function(){
		const result = await axios({
			method:"post",
			url:"/info",
			params:{
				a:1,
				b:2
			},
		});
		console.log(result);
	}
</script>
</html>